import java.io.File;

public class Demo3 {
    public static void main(String[] args) throws InterruptedException {
        File file = new File("./test.txt");
        // boolean result = file.delete();
        // 在进程退出时删除文件
        file.deleteOnExit();
        Thread.sleep(10000);
    }
}
